@ECHO Off
ECHO -------------------------------------------------------
ECHO - Welcome to the Dwarf Fortress Savegame RAW Updater. -
ECHO -------------------------------------------------------
ECHO .
ECHO Press 'U' to Update your savegames, or press 'Q' to Quit.
CHOICE /C:qu /N > nul
if errorlevel 2 goto start
goto end

:update_savegame
if %1==data\save\current GOTO :eof
ECHO ------------------------------------------
ECHO Updating Savegame: %1
XCOPY raw "%1\raw" /c /v /q /i /s /e /y
IF EXIST "%1\raw\objects\inorganic_stone_layer - Copy.txt" DEL "%1\raw\objects\inorganic_stone_layer - Copy.txt"
GOTO :eof

:start
IF EXIST "raw\objects\inorganic_stone_layer - Copy.txt" DEL "raw\objects\inorganic_stone_layer - Copy.txt"
FOR /d %%a IN (data\save\*.*) DO CALL :update_savegame %%a

ECHO .
ECHO .
ECHO ---------------------
ECHO - Update Completed. -
ECHO ---------------------
PAUSE

:end
